#!/bin/sh
#为Rocky10更换软件源

mkdir -p /etc/yum.repos.d/bak 
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/

cat > /etc/yum.repos.d/rocky.repo <<- eof
[AppStream]
name=Rocky Linux $releasever - AppStream
baseurl=https://mirrors.aliyun.com/rockylinux/10/AppStream/x86_64/os/
enabled=1

[BaseOS]
name=Rocky Linux $releasever - BaseOS
baseurl=https://mirrors.aliyun.com/rockylinux/10/BaseOS/x86_64/os/
enabled=1

[extras]
name=Rocky Linux $releasever - extras
baseurl=https://mirrors.aliyun.com/rockylinux/10/extras/x86_64/os/
enabled=1

eof

dnf clean all 
dnf makecache

echo "阿里云软件源配置完成！"